#ifndef __XPIG_H
#define __XPIG_H


typedef uint32_t Display;
typedef uint32_t Window;
typedef uint32_t XSetWindowAttributes;
typedef uint32_t Visual;
typedef uint32_t GC;
typedef uint32_t Drawable;
typedef uint32_t XGCValues;
typedef uint32_t Font;
typedef uint32_t XFontStruct;
typedef uint32_t Colormap;
typedef uint32_t XEvent;
typedef uint32_t Screen;
typedef uint32_t XColor;


Screen DefaultScreen(Display *d);
Colormap DefaultColormap(Display *d, Screen s);
Display *XOpenDisplay(char *display_name);
Window XcreateWindow(	Display *display, Window parent,
						int x, int y,
						int width, int height,
						unsigned int border_width,
						unsigned int depth, int class,
						Visual *visual,
						unsigned long valuemask,
						XSetWindowAttributes *attributes);

Window XCreateSimpleWindow(	Display * display,
							Window parent,
							int x, int y,
							unsigned int width,
							unsigned int height,
							unsigned int border_width,
							unsigned long border,
							unsigned long background);


void XMapWindow(Display *display, Window w);
void XMapSubwindows(Display * display, Window w);
void XUnmapWindow(Display * display, Window w);

void XDestroyWindow(Display * display, Window w);
void XDestroySubwindows(Display * display, Window w);


void XSelectInput(Display * display, Window w, long event_mask);

GC XCreateGC(Display * display, Drawable d, unsigned long valuemask,
             XGCValues * values);


void XSetFont(Display *display, GC gc, Font font);
void XSetForeground(Display *display, GC gc, unsigned long a_color);
void XSetBackground(Display *display, GC gc, unsigned long a_color);

void BlackPixel(Display * display, Screen screen);
void WhitePixel(Display * display, Screen screen);

void XDrawString(Display *display, Drawable d, GC gc, int x, int y,
				char * string, int string_length);
				
void XDrawLine(Display *display, Drawable d, GC gc, int x1, int y1, 
				int x2, int y2);
				
void XDrawRectangle(Display *display, Drawable d, GC gc, int x, 
				int y, unsigned int width, unsigned int height);
				
void XDrawArc(Display *display, Drawable d, GC gc, int x, int y,
		unsigned int width, unsigned int height, int angle1, int angle2);


#endif
